package com.swak.paxos.state;

import com.swak.paxos.Value;

import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

@Getter
@Setter
@Accessors(chain = true)
public class LearnerState implements State {
	private Value learnedValue;
	private boolean isLearned;

	public LearnerState() {
		this.init();
	}

	public void init() {
		this.learnedValue = NONE;
		this.isLearned = false;
	}

	public void learnValueWithoutWrite(Value value) {
		this.learnedValue = value;
		this.isLearned = true;
	}
}
